/**
 * Created by meiguizhinian on 2018/6/22
 * Copyright © 2018 lixiaolong. All rights reserved.
 */

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!cc.sys.isNative) {
	cc.Node.prototype.___onExit = cc.Node.prototype.onExit;
	cc.Node.prototype._onExitCallback = null;
	cc.Node.prototype.onExit = function () {
		if (this._onExitCallback) {
			this._onExitCallback();
		}
		this.___onExit();
	};
	cc.Node.prototype.setOnExitCallback = function (fun) {
		this._onExitCallback = fun;
	};
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
cc.Node.prototype._keypadEnabled = false;
cc.Node.prototype._keyboardListener = null;
cc.Node.prototype.onKeyPressed = function(keyCode, event) {

};
cc.Node.prototype.onKeyReleased = function(keyCode, event) {

};
cc.Node.prototype.setKeypadEnabled = function(enabled) {
	if (enabled !== this._keypadEnabled) {
		this._keypadEnabled = enabled;

		if (this._keyboardListener) {
			cc.eventManager.removeListener(this._keyboardListener);
			this._keyboardListener = null;
		}

		if (enabled) {
			this._keyboardListener = cc.EventListener.create({
				event : cc.EventListener.KEYBOARD,
				onKeyPressed : this.onKeyPressed,
				onKeyReleased : this.onKeyReleased,
			});
			cc.eventManager.addListener(this._keyboardListener, this);
		}
	}
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (!cc.Node.prototype.setRotation3D) {
	cc.Node.prototype.setRotation3D = function (rotation) {
		cc.log("html has not setRotation3D");
	}
}